﻿#region Copyright and License
/*==============================================================================
 *  Copyright (c) www.51mvc.com Corporation.  All rights reserved.
 * ===============================================================================
 * This code and information is provided "as is" without warranty of any kind,
 * either expressed or implied, including but not limited to the implied warranties
 * of merchantability and fitness for a particular purpose.
 * ===============================================================================
 * Licensed under the GNU General Public License (GPL) v2
 * http://www.51mvc.com/
 * Create By 小鱼(Leven)  - http://leven.com.cn
 * ==============================================================================*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Infancy.Core.Validation;

namespace Infancy.Core.Entities {
    /// <summary>
    /// 友情链接实体(目前测试用)
    /// </summary>
    public class FriendLink : ValidateEntityBase<FriendLink> {
        public int ID { get; set; }

        [RegexValidate(@"^\w{3,12}$", false, Message = "用户名不能为空")]
        public string Name { get; set; }

        public string Description { get; set; }

        [RegexValidate(@"^(http(s)?://)?([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?$",
            Message = "Url格式错误")]
        public string Url { get; set; }

        [RegexValidate(@"^(http(s)?://)?([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?$",
            true,
            Message = "图片Url格式错误")]
        public string ImageUrl { get; set; }

        public int Order { get; set; }

        public bool IsShow { get; set; }

        public bool IsShowIndex { get; set; }

        public FriendLink() {
            Name = String.Empty;
            Description = String.Empty;
            Url = String.Empty;
            ImageUrl = String.Empty;
            Order = 1000;
            IsShow = false;
            IsShowIndex = false;
        }
    }
}
